package org.holynite.poi.dsl.units

import org.apache.poi.util.Units

fun pt(points: Double): Int = (points / Units.EMU_PER_POINT / Units.POINT_DPI).toInt()

fun cm(length: Double): Int = (length / Units.EMU_PER_CENTIMETER / Units.POINT_DPI).toInt()

fun mm(length: Double): Int = (length / Units.EMU_PER_CENTIMETER / 10 / Units.POINT_DPI).toInt()

fun inch(inch: Double): Int = (inch / Units.PIXEL_DPI / Units.EMU_PER_PIXEL / Units.POINT_DPI).toInt()

fun charater(count: Double): Int = Units.charactersToEMU(count) / Units.POINT_DPI